cc.Class({
    extends: cc.Component,

    properties: {
        // foo: {
        //    default: null,      // The default value will be used only when the component attaching
        //                           to a node for the first time
        //    url: cc.Texture2D,  // optional, default is typeof default
        //    serializable: true, // optional, default is true
        //    visible: true,      // optional, default is true
        //    displayName: 'Foo', // optional
        //    readonly: false,    // optional, default is false
        // },
        // ...
        _reconnect:null,
    },

    // use this for initialization
    onLoad: function () {
        this._reconnect = cc.find("Canvas/reconnect");
        var self = this;
        var btnOk = cc.find("Canvas/reconnect/btn_ok");
        if(btnOk){
            cc.vv.utils.addClickEvent(btnOk,this.node,"ReConnect","onBtnOK");
        }
        
        var fn = function(data){
            self.node.off('disconnect',fn);
            self._reconnect.active = true;
        };
        
        this.node.on('disconnect',fn);
    },
    
    onBtnOK:function(){
        cc.director.loadScene("hall");
    }
    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});
